package com.basketball.gym.service;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.basketball.gym.pojo.Orders;
import com.baomidou.mybatisplus.extension.service.IService;
import com.basketball.gym.pojo.ResponseData;
import com.basketball.gym.pojo.User;

import java.text.ParseException;
import java.util.List;
import java.util.Map;

/**
 * <p>
 * 服务类
 * </p>
 *
 * @author 赵肖云
 * @since 2021-03-27
 */
public interface OrderService extends IService<Orders> {

    /**
     * 计算价格
     */
    ResponseData<Orders> calculatePrice(Orders order);

    /**
     * 发起订单
     */
    ResponseData<Orders> postOrder(Orders order, User user);

    /**
     * 充值
     */
    ResponseData<Object> topUp(Orders order, User user) throws ParseException;

    /**
     * 支付结果回调
     */
    void payResult(Map<String, Object> param);

    /**
     * 通过余额支付
     */
    ResponseData<Orders> payByBalance(Orders order, User user);

    /**
     * 通过微信支付
     */
    ResponseData<Object> payByWx(Orders order, User user);

    /**
     * 查询个人订单
     */
    ResponseData<List<Orders>> getOrders(Orders order, User user);

    /**
     * 取消订单
     */
    ResponseData<Orders> cancelOrder(Integer orderId, User user) throws ParseException;

    /**
     * 退款回调
     */
    void refundResult(Map<String, Object> param);

    /**
     * 取消订单
     */
    void cancelOrder(Integer orderId);

    /**
     * 管理员查询订单
     */
    ResponseData<IPage<Orders>> adminGetOrders(Orders order);

    /**
     * 管理员完成订单
     */
    ResponseData<Orders> adminFinishOrder(Orders order);

}
